<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        div {
            width: 250px;
            height: 250px;
            background-color: slateblue;
            color: #fff;
            margin: 10px auto;
            padding-top: 20px;
            padding-left: 20px;
        }
        .a {
            box-sizing: border-box;
            border: 20px solid #f00;
            background-color: #fff;
            color: #f00;
        }
    </style>
</head>
<body>
    <div id="dv">
        鼠标移入改变样式,鼠标移除恢复。
    </div>
</body>
<script>
    var dv = document.getElementById('dv')
    // var pp = document.getElementById('pp')
    dv.onmouseover = function () {
        dv.className = 'a'
    }
    dv.onmouseout = function () {
        dv.className = 'div'
    }
</script>
</html>